package com.example.service.impl;

import com.example.dao.IPermissionDao;
import com.example.domain.Permission;
import com.example.domain.Role;
import com.example.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Date: 2021年08月21日 19:57
 * @Author: LHSAMA
 */
@Service
public class PermissionServiceImpl implements IPermissionService {
    @Autowired
    private IPermissionDao permissionDao;

    @Override
    public List<Permission> findAll() {
        return permissionDao.findAll();
    }

    @Override
    public void save(Permission permission) {
        permissionDao.save(permission);
    }

    @Override
    public void deletePermission(String id) {
        permissionDao.deleteRolePermission(id);
        permissionDao.deletePermission(id);
    }
}
